from abc import ABC, abstractmethod


class InferencerBase(ABC):
    def __init__(self, model_name, device='cuda'):
        # super(InferencerBase, self).__init__()
        # self.model = self._load_model(model_name)
        pass

    def _load_model(self, model_name):
        # raise NotImplemented
        pass
    
    def preprocess(self, input_data):
        # raise NotImplemented
        pass
    
    def postprocess(self, outputs):
        # raise NotImplemented
        pass
    
    @abstractmethod
    def inference(self, input_data):
        preprocessed = self.preprocess(input_data)
        raw_output = self.model(preprocessed)
        result = self.postprocess(raw_output)
        return result





